package 单例;

/**
 * @Author Klys
 * @Date 2023/3/5 14:04
 * @Description
 * @Version 1.0
 */

//饿汉式
public class Hungary {
    //直接new出来
    private static Hungary instance = new Hungary();

    private Hungary() {

    }

    public static Hungary getInstance() {
        return instance;
    }

    public void sayHello() {
        System.out.println("Hello");
    }
}
